<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<include file="public:headtop" />
</head>

<body>
<include file="public:head" />
<div class="s_bottom"></div>
<script src="__STATIC__/js/jquery/jquery10.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$("div.module_special .wrap .major ul.list li:last-child").addClass("remove_bottom_line");
});
var active=0,
	as=document.getElementById('pagenavi').getElementsByTagName('a');
	
for(var i=0;i<as.length;i++){
	(function(){
		var j=i;
		as[i].onclick=function(){
			t2.slide(j);
			return false;
		}
	})();
}
var t2=new TouchSlider({id:'sliderlist', speed:600, timeout:6000, before:function(index){
		as[active].className='';
		active=index;
		as[active].className='active';
	}});
</script>


<div id="content">
    <div class="module_special tbr">
        
        <div class="wrap">
            <div class="wrap_child">
                <div class="major">
                     <ul class="list">
                     <volist name="item_list" id="item">
                     <li>
                     <div class="pic">
                     	<a href="{:U('Item/index',array('id'=>$item['id'],'tokenTall'=>$tokenTall))}"><img  src="{:$item['img']}"></a>
                     </div>
                     <div class="good_content">
                     <h3>
                     	<a href="{:U('Item/index',array('id'=>$item['id'],'tokenTall'=>$tokenTall))}">{$item.title}</a>
                     </h3>
                     <p>¥{$item.price}<span class="love" style="float:right; margin-right:10px; font-weight: normal;"><input class="itemid" type="hidden" value="{:$item['id']}"><img src="__STATIC__/weixin/images/bg5.png" height="10px"><span class="lv"><if condition="$item_like[$item['id']] eq ''">0<else/>{:$item_like[$item['id']]}</if></span></span></p>
                     </div>
                     <span class="show_good">
                     	<a href="{:U('Item/index',array('id'=>$item['id']))}"></a>
                     </span>
                     </li>
                     </volist>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
</div>
<script>
$(function(){
	$(".love").click(function(e){
		var itemid=$(this).children(".itemid").val();
		var val=$(this).children(".lv");
		$.get("{:U('book/like_item')}",{item_id:itemid},function(data){
			if(data==2){
				anp(e);
				val.html(parseInt(val.html())+1+0);
			}else if(data==3){
				//alert("已赞过");
			}else if(data==1){
				alert("亲，你还没有登录哦！");
			}else{
				
			}
		});
	});
	function anp(e){
		//var n=Math.round(Math.random()*10);
		var $i=$("<b>").text("+1");
		var x=e.pageX,y=e.pageY;
		$i.css({top:y-20,left:x,position:"absolute",color:"#E94F06"});
		$("body").append($i);
		$i.animate({top:y-180,opacity:0,"font-size":"1.5em"},1500,function(){
			$i.remove();
		});
		e.stopPropagation();
	}	
});
</script>
<include file="public:footer" />

</body>
</html>
